<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.traits</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.traits";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.traits.html" class="symbol">std.traits</a></h1>
  
<div class="summary">Templates with which to extract information about
 types at compile time.</div>
<dl>
<dt class="decl">template <a class="symbol _template" name="ReturnType" href="./htmlsrc/std.traits.html#L32" kind="template" beg="32" end="35">ReturnType</a><span class="tparams">(alias dg)</span>; <a title="Permalink to this symbol" href="#ReturnType" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L32">#</a></dt>
<dt class="decl">template <a class="symbol _template" name="ReturnType:2" href="./htmlsrc/std.traits.html#L38" kind="template" beg="38" end="44">ReturnType</a><span class="tparams">(dg)</span>; <a title="Permalink to this symbol" href="#ReturnType:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L38">#</a></dt>
<dd class="ddef">
<div class="summary">Get the type of the return value from a function,
 a pointer to function, or a delegate.</div>
<p class="sec_header">Example:</p><pre class="d_code">
<span class="k">import</span> <span class="i">std</span>.<span class="i">traits</span>;
<span class="k">int</span> <span class="i">foo</span>();
<span class="i">ReturnType</span>!(<span class="i">foo</span>) <span class="i">x</span>;   <span class="lc">// x is declared as int</span>
</pre>
<dl>
<dt class="decl">alias ReturnType!(typeof(dg)) <a class="symbol _alias" name="ReturnType.ReturnType" href="./htmlsrc/std.traits.html#L34" kind="alias" beg="34" end="34">ReturnType</a>; <a title="Permalink to this symbol" href="#ReturnType.ReturnType" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L34">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">template <a class="symbol _template" name="ParameterTypeTuple" href="./htmlsrc/std.traits.html#L57" kind="template" beg="57" end="60">ParameterTypeTuple</a><span class="tparams">(alias dg)</span>; <a title="Permalink to this symbol" href="#ParameterTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L57">#</a></dt>
<dt class="decl">template <a class="symbol _template" name="ParameterTypeTuple:2" href="./htmlsrc/std.traits.html#L63" kind="template" beg="63" end="73">ParameterTypeTuple</a><span class="tparams">(dg)</span>; <a title="Permalink to this symbol" href="#ParameterTypeTuple:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L63">#</a></dt>
<dd class="ddef">
<div class="summary">Get the types of the paramters to a function,
 a pointer to function, or a delegate as a tuple.</div>
<p class="sec_header">Example:</p><pre class="d_code">
<span class="k">import</span> <span class="i">std</span>.<span class="i">traits</span>;
<span class="k">int</span> <span class="i">foo</span>(<span class="k">int</span>, <span class="k">long</span>);
<span class="k">void</span> <span class="i">bar</span>(<span class="i">ParameterTypeTuple</span>!(<span class="i">foo</span>));      <span class="lc">// declares void bar(int, long);</span>
<span class="k">void</span> <span class="i">abc</span>(<span class="i">ParameterTypeTuple</span>!(<span class="i">foo</span>)[<span class="n">1</span>]);   <span class="lc">// declares void abc(long);</span>
</pre>
<dl>
<dt class="decl">alias ParameterTypeTuple!(typeof(dg)) <a class="symbol _alias" name="ParameterTypeTuple.ParameterTypeTuple" href="./htmlsrc/std.traits.html#L59" kind="alias" beg="59" end="59">ParameterTypeTuple</a>; <a title="Permalink to this symbol" href="#ParameterTypeTuple.ParameterTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L59">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">template <a class="symbol _template" name="FieldTypeTuple" href="./htmlsrc/std.traits.html#L83" kind="template" beg="83" end="89">FieldTypeTuple</a><span class="tparams">(S)</span>; <a title="Permalink to this symbol" href="#FieldTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L83">#</a></dt>
<dd class="ddef">
<div class="summary">Get the types of the fields of a struct or class.
 This consists of the fields that take up memory space,
 excluding the hidden fields like the virtual function
 table pointer.</div>
<dl>
<dt class="decl">alias typeof(S.tupleof) <a class="symbol _alias" name="FieldTypeTuple.FieldTypeTuple" href="./htmlsrc/std.traits.html#L86" kind="alias" beg="86" end="86">FieldTypeTuple</a>; <a title="Permalink to this symbol" href="#FieldTypeTuple.FieldTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L86">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">template <a class="symbol _template" name="BaseTypeTuple" href="./htmlsrc/std.traits.html#L110" kind="template" beg="110" end="116">BaseTypeTuple</a><span class="tparams">(A)</span>; <a title="Permalink to this symbol" href="#BaseTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L110">#</a></dt>
<dd class="ddef">
<div class="summary">Get a TypeTuple of the base class and base interfaces of
 this class or interface.</div>
<p class="sec_header">Example:</p><pre class="d_code">
<span class="k">import</span> <span class="i">std</span>.<span class="i">traits</span>, <span class="i">std</span>.<span class="i">typetuple</span>, <span class="i">std</span>.<span class="i">stdio</span>;
<span class="k">interface</span> <span class="i">I</span> { }
<span class="k">class</span> <span class="i">A</span> { }
<span class="k">class</span> <span class="i">B</span> : <span class="i">A</span>, <span class="i">I</span> { }

<span class="k">void</span> <span class="i">main</span>()
{
    <span class="k">alias</span> <span class="i">BaseTypeTuple</span>!(<span class="i">B</span>) <span class="i">TL</span>;
    <span class="i">writefln</span>(<span class="k">typeid</span>(<span class="i">TL</span>));	<span class="lc">// prints: (A,I)</span>
}
</pre>
<dl>
<dt class="decl">alias P <a class="symbol _alias" name="BaseTypeTuple.BaseTypeTuple" href="./htmlsrc/std.traits.html#L113" kind="alias" beg="113" end="113">BaseTypeTuple</a>; <a title="Permalink to this symbol" href="#BaseTypeTuple.BaseTypeTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L113">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.traits.html#L118" kind="unittest" beg="118" end="128">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L118">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">template <a class="symbol _template" name="isStaticArray_impl" href="./htmlsrc/std.traits.html#L132" kind="template" beg="132" end="154">isStaticArray_impl</a><span class="tparams">(T)</span>; <a title="Permalink to this symbol" href="#isStaticArray_impl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L132">#</a></dt>
<dd class="ddef">
<dl>
<dt class="decl">T <a class="symbol _variable" name="isStaticArray_impl.inst" href="./htmlsrc/std.traits.html#L134" kind="variable" beg="134" end="134">inst</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#isStaticArray_impl.inst" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L134">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">bool <a class="symbol _variable" name="isStaticArray_impl.res" href="./htmlsrc/std.traits.html#L142" kind="variable" beg="142" end="142">res</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#isStaticArray_impl.res" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L142">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">template <a class="symbol _template" name="isStaticArray" href="./htmlsrc/std.traits.html#L158" kind="template" beg="158" end="161">isStaticArray</a><span class="tparams">(T)</span>; <a title="Permalink to this symbol" href="#isStaticArray" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L158">#</a></dt>
<dd class="ddef">
<div class="summary">Detect whether type T is a static array.</div>
<dl>
<dt class="decl">bool <a class="symbol _variable" name="isStaticArray.isStaticArray" href="./htmlsrc/std.traits.html#L160" kind="variable" beg="160" end="160">isStaticArray</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#isStaticArray.isStaticArray" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L160">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">template <a class="symbol _template" name="isExpressionTuple" href="./htmlsrc/std.traits.html#L174" kind="template" beg="174" end="180">isExpressionTuple</a><span class="tparams">(T ...)</span>; <a title="Permalink to this symbol" href="#isExpressionTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L174">#</a></dt>
<dd class="ddef">
<div class="summary">Tells whether the tuple T is an expression tuple.</div>
<dl>
<dt class="decl">bool <a class="symbol _variable" name="isExpressionTuple.isExpressionTuple" href="./htmlsrc/std.traits.html#L177" kind="variable" beg="177" end="177">isExpressionTuple</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#isExpressionTuple.isExpressionTuple" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.traits.html#L177">#</a></dt>
<dd class="ddef"></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Public Domain</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:40:12 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>